﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Student
    {
        private string name;
        private int age;
        private string sex;

        public string Name
        {
            get { return this.name; }
            set
            {
                this.name = value;
                if (name.Equals("李四"))
                {
                    Console.WriteLine("你输入的名字有误！");
                    this.name = "";
                }
            }
        }
        public int Age
        {
            get { return this.age; }
            set { this.age = value; }
        }
        public string Sex
        {
            get { return this.sex; }
            set
            {
                this.sex = value;
                if (sex.Equals("人妖"))
                {
                    Console.WriteLine("你输入的性别有误！");
                    this.sex = "";
                }
            }
        }


        public void Introduce()
        {
            Console.WriteLine("我的名字是{0}，我的年龄是{1}，我的性别是{2}", this.name, this.age, this.sex);
        }
     }
}
